console.log('worker线程开始执行')
self.onmessage = () => {
  console.log(1)
  self.postMessage(Math.random())
}
// 1.on注册
self.onmessage = () => {
  console.log(222)
  self.postMessage(222)
}
// 2.addEventListener注册
self.addEventListener('message', () => {
  console.log(333)
  self.postMessage(333)
})
console.log('worker线程结束执行')
